package file

import "path/filepath"

func GetDir(path string) string {
	return filepath.Dir(path)
}

func GetParentDir(path string) string {
	dir := GetDir(path)
	pts := filepath.SplitList(dir)
	if len(pts) == 1 {
		return dir
	}

	return filepath.Join(pts[:len(pts)-1]...)
}
